﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Baotime : MonoBehaviour {
    private int atime;
    private float btime;
    private int ctime;
    public UILabel TimeMiaoDown;
    public UILabel TimeFenDown;
    public UILabel TimeHDown;
    // Use this for initialization
    void Start()
    {
        TimeMiaoDown.text = btime.ToString();
        TimeFenDown.text = atime.ToString();
        TimeHDown.text = ctime.ToString();
        atime = 59;
        btime = 59;
        ctime = 1;
    }

    // Update is called once per frame
    void Update()
    {
        btime -= Time.deltaTime;
        TimeMiaoDown.text = Mathf.Round(btime).ToString();
        TimeFenDown.text = atime.ToString();
        TimeHDown.text = ctime.ToString();
        if (btime < 0)
        {
            atime--;
            btime = 59;
            if (atime < 0)
            {
                atime = 59;
                if (ctime < 0)
                {
                    ctime = 1;
                }
            }
        }
    }
}
